package com.bookcode.dao;


import com.bookcode.entity.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface StudentRepository extends JpaRepository<Student,Long> {
    /**
     * 根据姓名查询学生
     */
    @Query("from Student s where s.name=:name")
    Student findStudentByName(@Param("name") String name);

}